-module(all_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-define(SERVER, ?MODULE). % macro that just defines this module as server

start_link() ->
    supervisor:start_link({local, ?SERVER},?MODULE, []).

init([]) ->
    Restart = {one_for_all, 5, 1000},
    ChildSpec1 = {child1,
                  {all_serv1, start_link, []},
                  transient,
                  3000,
                  worker,
                  [all_serv1]},
    ChildSpec2 = {child2,
                  {all_serv2, start_link, []},
                  transient,
                  3000,
                  worker,
                  [all_serv2]},
    Children = [ChildSpec1, ChildSpec2],
    SupervisorSpec = {Restart, Children},
    {ok, SupervisorSpec}.
